<?php


namespace App\Consts;

/**
 * 全局计数常量定义
 * @author dumpling
 */
class GlobalCounterConst
{
    // 值不用驼峰，是因为要返回给前端
    public static $actionTypeMap = [
        self::ACTION_TYPE_SHARE => 'share',
        self::ACTION_TYPE_FORWARD => 'forward',
        self::ACTION_TYPE_COLLECT => 'collect',
        self::ACTION_TYPE_COMMENT => 'comment',
        self::ACTION_TYPE_REPLY => 'reply',
        self::ACTION_TYPE_VIEW => 'view',
        self::ACTION_TYPE_LIKE => 'like',
        self::ACTION_TYPE_REPORT => 'report',

        self::ACTION_TYPE_ATTENTION => 'attention',
        self::ACTION_TYPE_FANS => 'fans',
        self::ACTION_TYPE_PUBLIC_NOTE => 'public_note',
        self::ACTION_TYPE_SELF_NOTE => 'self_note',
        self::ACTION_TYPE_DYNAMIC => 'dynamic',
        self::ACTION_TYPE_ARTICLE => 'article',
        self::ACTION_TYPE_COLLECT_PACKAGE => 'collect_package',
        self::ACTION_TYPE_COLLECT_PACKAGE_SELF_TARGET => 'self_collect',
    ];

    // 计数-1的动作
    public static $decreaseActionTypeArr = [
        self::ACTION_TYPE_SELF_NOTE,
        self::ACTION_TYPE_DEL_COMMENT,
        self::ACTION_TYPE_DEL_REPLY,
        self::ACTION_TYPE_CANCEL_LIKE,
        self::ACTION_TYPE_CANCEL_COLLECT,
        self::ACTION_TYPE_CANCEL_ATTENTION,
        self::ACTION_TYPE_DEL_PUBLIC_NOTE,
        self::ACTION_TYPE_DEL_SELF_NOTE,
        self::ACTION_TYPE_DEL_DYNAMIC,
        self::ACTION_TYPE_DEL_ARTICLE,
        self::ACTION_TYPE_DEL_COLLECT_PACKAGE,
        self::ACTION_TYPE_SHIELD_ARTICLE,
        self::ACTION_TYPE_SHIELD_NOTE,
        self::ACTION_TYPE_DEL_COLLECT_PACKAGE_SELF_TARGET,
    ];

    public const ACTION_TYPE_SHARE = 1; // 分享
    public const ACTION_TYPE_FORWARD = 2; // 转发
    public const ACTION_TYPE_COLLECT = 3; // 收藏
    public const ACTION_TYPE_COMMENT = 4; // 评论
    public const ACTION_TYPE_REPLY = 5; // 回复
    public const ACTION_TYPE_VIEW = 6; // 浏览
    public const ACTION_TYPE_LIKE = 7; // 点赞
    public const ACTION_TYPE_REPORT = 8; // 举报

    public const ACTION_TYPE_ATTENTION = 9; // 关注
    public const ACTION_TYPE_FANS = 10; // 粉丝
    public const ACTION_TYPE_PUBLIC_NOTE = 11; // 公开笔记数
    public const ACTION_TYPE_SELF_NOTE = 12; // 私有笔记数
    public const ACTION_TYPE_DYNAMIC = 13; // 动态
    public const ACTION_TYPE_ARTICLE = 14; // 文章
    public const ACTION_TYPE_COLLECT_PACKAGE = 15; // 收藏夹

    public const ACTION_TYPE_DEL_COMMENT = 16; // 删除评论
    public const ACTION_TYPE_DEL_REPLY = 17; // 删除回复
    public const ACTION_TYPE_CANCEL_LIKE = 18; // 取消点赞
    public const ACTION_TYPE_CANCEL_COLLECT = 19; // 取消收藏
    public const ACTION_TYPE_CANCEL_ATTENTION = 20; // 取消关注
    public const ACTION_TYPE_DEL_PUBLIC_NOTE = 21; // 删除公开笔记
    public const ACTION_TYPE_DEL_SELF_NOTE = 22; // 删除私有笔记
    public const ACTION_TYPE_DEL_DYNAMIC = 23; // 删除动态
    public const ACTION_TYPE_DEL_ARTICLE = 24; // 删除文章
    public const ACTION_TYPE_DEL_COLLECT_PACKAGE = 25; // 删除收藏夹
    public const ACTION_TYPE_SHIELD_ARTICLE = 26; // 屏蔽文章
    public const ACTION_TYPE_SHIELD_NOTE = 27; // 屏蔽笔记
    public const ACTION_TYPE_RECOMMEND = 28; // 推荐
    public const ACTION_TYPE_CANCEL_RECOMMEND = 29; // 取消推荐

    // 注释见：https://thoughts.teambition.com/workspaces/5e23ee5e8d0a96001ac16c9e/docs/5ff41c77eaa1190001e0e608
    public const ACTION_TYPE_COLLECT_PACKAGE_SELF_TARGET = 30; // 收藏夹私密内容
    public const ACTION_TYPE_DEL_COLLECT_PACKAGE_SELF_TARGET = 31; // 删除收藏夹私密内容

    public const ACTION_TYPE_TOPIC_VIEW = 32; // 浏览话题

    public const COUNT_SHARE = 'share';//分享数
    public const COUNT_FORWARD = 'forward';//转发数
    public const COUNT_COLLECT = 'collect';//收藏数
    public const COUNT_LIKE = 'like';//点赞数
    public const COUNT_COMMENT = 'comment';//评论数
    public const COUNT_REPLY = 'reply';//回复数
    public const COUNT_REPORT = 'report';//举报数
    public const COUNT_ATTENTION = 'attention';//关注数
    public const COUNT_FANS = 'fans';//粉丝数
    public const COUNT_PUBLIC_NOTE = 'public_note';//公开笔记数
    public const COUNT_SELF_NOTE = 'self_note';//私有笔记数
    public const COUNT_DYNAMIC = 'dynamic';//动态数
    public const COUNT_ARTICLE = 'article';//文章数
    public const COUNT_VIEW = 'view';//浏览数
    public const COUNT_COLLECT_PACKAGE = 'collect_package';//收藏夹数
    public const COUNT_USER_RECOMMEND = 'recommend'; // 推荐数
    public const FAKE_VIEW = 'fake_view';// 浏览基数
    public const FAKE_COLLECT = 'fake_collect';//收藏基数
    public const FAKE_LIKE = 'fake_like';//点赞基数
    public const FAKE_HOT = 'fake_hot';//热度基数
    public const FAKE_RECOMMEND = 'fake_recommend'; // 推荐基数
    public const COUNT_COLLECT_PACKAGE_CONTENT_PRIVATE = 'self_collect';// 收藏夹私密内容数量
    public const COUNT_HOT = 'hot'; // 热度
    public const COUNT_HOT_TARGET = 'hot_target'; // 热门内容数
    public const COUNT_TOTAL = 'total'; // 总数

    public const INCREASE = 1; // 计数 + 1
    public const DECREASE = -1; // 计数 - 1
}
